package screen;

import java.util.ArrayList;

import javax.vecmath.Color3f;

public class Pixel {

	private ArrayList<Color3f> colors;

	public Pixel() {
		this.colors = new ArrayList<Color3f>();
	}

	public void addColor(Color3f c) {
		this.colors.add(c);
	}

	public Color3f averageColors() {
		float rSum = 0.0f, gSum = 0.0f, bSum = 0.0f;
		for (Color3f c : colors) {
			rSum += c.getX();
			gSum += c.getY();
			bSum += c.getZ();
		}
		return new Color3f(rSum / colors.size(), gSum / colors.size(), bSum
				/ colors.size());
	}

}
